package com.xio.cloud.controller;

import com.xio.cloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: xio
 * @Description: 服务消费者控制层
 * @Date: 2020/10/23 18:28
 */
@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/payment/echo/{string}")
    public String echo(@PathVariable("string") String string) {
        log.info("- - - - > > > > in order " + serverPort);
        return paymentFeignService.echo(string);
    }
}
